package dao;

import mappers.ManyMapper;
import model.Many;
import org.apache.ibatis.session.SqlSession;
import util.MyBatisUtil;

public class ManyDAO {
    public Many getManyById(int id) {
        SqlSession sqlSession = MyBatisUtil.getSqlSessionFactory().openSession();
        try {
            ManyMapper manyMapper = sqlSession.getMapper(ManyMapper.class);
            return manyMapper.getManyById(id);
        }
        finally {
            sqlSession.close();
        }
    }

}
